package com.tools.seckillgoods;

import android.os.Parcel;
import android.os.Parcelable;


public class SecKillGoods implements Parcelable {
    private String id; //产品id
    private String goodsCode; //产品编号
    private String goodsName; //产品名称
    private int productDeadline; //产品期限
    private float annualInterestRate; //年化利率
    private int minAmount; //起存金额
    private int increasingAmount; //递增金额
    private int limitForOne; //单人限额
    private int limitForDay; //单人限额
    private int riskGrade; //风险等级
    private String valueDate; //起息日
    private int interestSettlementWay; //结息方式
    private String dueDate; //到期日
    private String secKillGoodsId; //秒杀产品id
    private int secKillPrice; //秒杀价
    private int secKillStock; //剩余库存
    private String startDate; //秒杀开始时间
    private String endDate; //秒杀结束时间

    public SecKillGoods() {
    }

    public SecKillGoods(String id, String goodsCode, String goodsName, int productDeadline, float annualInterestRate, int minAmount, int increasingAmount, int limitForOne, int limitForDay, int riskGrade, String valueDate, int interestSettlementWay, String dueDate, String secKillGoodsId, int secKillPrice, int secKillStock, String startDate, String endDate) {
        this.id = id;
        this.goodsCode = goodsCode;
        this.goodsName = goodsName;
        this.productDeadline = productDeadline;
        this.annualInterestRate = annualInterestRate;
        this.minAmount = minAmount;
        this.increasingAmount = increasingAmount;
        this.limitForOne = limitForOne;
        this.limitForDay = limitForDay;
        this.riskGrade = riskGrade;
        this.valueDate = valueDate;
        this.interestSettlementWay = interestSettlementWay;
        this.dueDate = dueDate;
        this.secKillGoodsId = secKillGoodsId;
        this.secKillPrice = secKillPrice;
        this.secKillStock = secKillStock;
        this.startDate = startDate;
        this.endDate = endDate;
    }

    public String getId(){
        return id;
    }

    public void setId(String id){
        this.id = id;
    }

    public String getGoodsCode(){
        return goodsCode;
    }

    public void setGoodsCode(String goodsCode){
        this.goodsCode = goodsCode;
    }

    public String getName() {
        return goodsName;
    }

    public void setName(String goodsName) {
        this.goodsName = goodsName;
    }

    public int getProductDeadline(){
        return productDeadline;
    }

    public void setProductDeadline(int productDeadline){
        this.productDeadline = productDeadline;
    }

    public double getAnnualInterestRate(){
        return annualInterestRate;
    }

    public void setAnnualInterestRate(float annualInterestRate){
        this.annualInterestRate = annualInterestRate;
    }

    public int getMinAmount(){
        return minAmount;
    }

    public void setMinAmount(int minAmount){
        this.minAmount = minAmount;
    }

    public int getIncreasingAmount(){
        return increasingAmount;
    }

    public void setIncreasingAmount(int increasingAmount){
        this.increasingAmount = increasingAmount;
    }

    public int getLimitForOne(){
        return limitForOne;
    }

    public void setLimitForOne(int limitForOne){
        this.limitForOne = limitForOne;
    }

    public int getLimitForDay(){
        return limitForDay;
    }

    public void setLimitForDay(int limitForDay){
        this.limitForDay = limitForDay;
    }

    public int getRiskGrade(){
        return riskGrade;
    }

    public void setRiskGrade(int riskGrade){
        this.riskGrade = riskGrade;
    }

    public String getValueDate(){
        return valueDate;
    }

    public void setValueDate(String valueDate){
        this.valueDate = valueDate;
    }

    public int getInterestSettlementWay(){
        return interestSettlementWay;
    }

    public void setInterestSettlementWay(int interestSettlementWay){
        this.interestSettlementWay = interestSettlementWay;
    }

    public String getDueDate(){
        return dueDate;
    }

    public void setDueDate(String dueDate){
        this.dueDate = dueDate;
    }

    public String getSecKillGoodsId(){
        return secKillGoodsId;
    }

    public void setSecKillGoodsId(String secKillGoodsId){
        this.secKillGoodsId = secKillGoodsId;
    }

    public int getSecKillPrice(){
        return secKillPrice;
    }

    public void setSecKillPrice(int secKillPrice) {
        this.secKillPrice = secKillPrice;
    }

    public int getSecKillStock(){
        return secKillStock;
    }

    public void setSecKillStock(int secKillStock) {
        this.secKillStock = secKillStock;
    }

    public String getStartDate(){
        return startDate;
    }

    public void setStartDate(String startDate){
        this.startDate = startDate;
    }

    public String getEndDate(){
        return endDate;
    }

    public void setEndDate(String endDate){
        this.endDate = endDate;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(id);
        dest.writeString(goodsCode);
        dest.writeString(goodsName);
        dest.writeInt(productDeadline);
        dest.writeFloat(annualInterestRate);
        dest.writeInt(minAmount);
        dest.writeInt(increasingAmount);
        dest.writeInt(limitForOne);
        dest.writeInt(limitForDay);
        dest.writeInt(riskGrade);
        dest.writeString(valueDate);
        dest.writeInt(interestSettlementWay);
        dest.writeString(dueDate);
        dest.writeString(secKillGoodsId);
        dest.writeInt(secKillPrice);
        dest.writeInt(secKillStock);
        dest.writeString(startDate);
        dest.writeString(endDate);
    }

    public static final Parcelable.Creator<SecKillGoods> CREATOR = new Parcelable.Creator<SecKillGoods>() {
        @Override
        public SecKillGoods createFromParcel(Parcel source) {
            //从Parcel中读取数据
            //此处read顺序依据write顺序
            return new SecKillGoods(source.readString(),
                                    source.readString(),
                                    source.readString(),
                                    source.readInt(),
                                    source.readFloat(),
                                    source.readInt(),
                                    source.readInt(),
                                    source.readInt(),
                                    source.readInt(),
                                    source.readInt(),
                                    source.readString(),
                                    source.readInt(),
                                    source.readString(),
                                    source.readString(),
                                    source.readInt(),
                                    source.readInt(),
                                    source.readString(),
                                    source.readString());
        }

        @Override
        public SecKillGoods[] newArray(int size) {
            return new SecKillGoods[size];
        }
    };
}
